@import "../../../style/default";

/* apes-tree */
$tree-prefix-cls: #{$style-prefix}-tree;
/* apes-treenode */
$treenode-prefix-cls: #{$style-prefix}-treenode;

/* checkbox disabled */
.#{$tree-prefix-cls}-disabled .#{$tree-prefix-cls} .#{$style-prefix}-chkbox .#{$style-prefix}-chkbox-box {
  background: #f5f5f5;
  &:hover {
    background: #f5f5f5;
  }
}

.#{$tree-prefix-cls} {
  box-sizing: border-box;
  min-width: 18em;
  .#{$treenode-prefix-cls}-selectable {
    &.#{$treenode-prefix-cls}-content {
      cursor: pointer;
    }
  }
  .#{$tree-prefix-cls}-container {
    height: 100%;
    margin: 0;
    overflow: auto;
    padding: .25em;
    white-space: nowrap;
  }
  .#{$tree-prefix-cls}-empty-message {
    padding: .25em;
  }
  .#{$treenode-prefix-cls}-children {
    margin: 0;
    padding: 0 0 0 1em;
  }
  .#{$treenode-prefix-cls} {
    background-attachment: scroll;
    background-color: transparent;
    background-image: none;
    background-position: 0 0;
    background-repeat: repeat-y;
    list-style: none outside none;
    margin: 0;
    padding: .125em 0 0 0;
    .#{$treenode-prefix-cls}-content {
      .#{$tree-prefix-cls}-toggler {
        width: 1.28em;
        font-size: 1.1em;
        text-align: center;
        vertical-align: middle;
        display: inline-block;
        color: $tree-default-color;
        margin-top: 0.15em;
      }
      .#{$treenode-prefix-cls}-icon {
        vertical-align: middle;
        display: inline-block;
        margin: 0.2em 0.2em 0 0.2em;
        font-size: 1.1em;
        color: $tree-default-color;
      }
      .#{$treenode-prefix-cls}-label {
        margin: 0;
        vertical-align: middle;
        display: inline-block;
        padding: 0 5px;
        transition: all .3s;
        &.#{$style-prefix}-state-highlight {
          background-color: $tree-primary-bg;
          color: $tree-primary-color;
          .#{$tree-prefix-cls}-toggler,
          .#{$treenode-prefix-cls}-icon {
            color: $tree-primary-color;
          }
        }
      }
    }
    &.#{$treenode-prefix-cls}-leaf {
      > .#{$treenode-prefix-cls}-content {
        > .#{$tree-prefix-cls}-toggler {
          visibility: hidden;
        }
      }
    }
  }
  &.#{$tree-prefix-cls}-selectable {
    .#{$treenode-prefix-cls} {
      .#{$treenode-prefix-cls}-content {
        .#{$treenode-prefix-cls}-label:not(.#{$style-prefix}-state-highlight):hover {
          background-color: $tree-default-bg-h;
          color: $tree-default-color-h;
        }
      }
    }
  }
  .#{$treenode-prefix-cls}-droppoint {
    height: 4px;
    list-style-type: none;
  }
  .#{$treenode-prefix-cls}-droppoint-active {
    border: 0 none;
  }
  .#{$tree-prefix-cls}-toggler {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
  }
  .#{$treenode-prefix-cls}-icon {
    display: inline-block;
    vertical-align: middle;
  }
  .#{$treenode-prefix-cls}-label {
    display: inline-block;
    padding: 0 .25em;
    vertical-align: middle;
    &.#{$style-prefix}-state-hover,
    &.#{$style-prefix}-state-highlight {
      font-weight: normal;
      border: 0 none;
    }
  }
  /** Horizontal Tree **/
  &.#{$tree-prefix-cls}-horizontal {
    width: auto;
    padding: .5em 0;
    overflow: auto;
    table,
    tr,
    td {
      border-collapse: collapse;
      margin: 0;
      padding: 0;
      vertical-align: middle;
    }
    .#{$tree-prefix-cls}-toggler {
      vertical-align: middle;
      margin: 0;
    }
    .#{$treenode-prefix-cls}-content {
      font-weight: normal;
      padding: 0.4em 1em 0.4em 0.2em;
      background-color: $tree-default-bg;
      border: 1px solid $tree-horizontal-border;
      transition: all .3s;
      &.#{$treenode-prefix-cls}-selectable {
        .#{$treenode-prefix-cls}-label:not(.#{$style-prefix}-state-highlight):hover {
          background-color: inherit;
          color: inherit;
        }
      }
      &.#{$treenode-prefix-cls}-selectable:not(.#{$style-prefix}-state-highlight):hover {
        background-color: $tree-default-bg-h;
        color: $tree-default-color-h;
      }
      &.#{$style-prefix}-state-highlight {
        background-color: $tree-primary-bg;
        color: $tree-primary-color;
        .#{$tree-prefix-cls}-toggler,
        .#{$treenode-prefix-cls}-icon {
          color: $tree-primary-color;
        }
      }
      .#{$treenode-prefix-cls}-label {
        transition: unset;
      }
    }
    .#{$tree-prefix-cls}-node-label {
      margin: 0;
    }
    .#{$treenode-prefix-cls}-parent {
      .#{$treenode-prefix-cls}-content {
        font-weight: normal;
        white-space: nowrap;
      }
    }
    .#{$treenode-prefix-cls} {
      background: url("app/shared/apes/tree-display/images/line.gif") repeat-x scroll center center transparent;
      padding: .25em 2.5em;
      &.#{$treenode-prefix-cls}-leaf,
      &.#{$treenode-prefix-cls}-collapsed {
        padding-right: 0;
      }
      &.#{$treenode-prefix-cls}-leaf {
        > .#{$treenode-prefix-cls}-content {
          > .#{$tree-prefix-cls}-toggler {
            visibility: hidden;
          }
        }
      }
    }
    .#{$treenode-prefix-cls}-children {
      padding: 0;
      margin: 0;
    }
    .#{$treenode-prefix-cls}-connector {
      width: 1px;
    }
    .#{$treenode-prefix-cls}-connector-table {
      height: 100%;
      width: 1px;
    }
    .#{$treenode-prefix-cls}-connector-line {
      background: url("app/shared/apes/tree-display/images/line.gif") repeat-y scroll 0 0 transparent;
      width: 1px;
    }
    table {
      height: 0;
    }
    .#{$style-prefix}-chkbox {
      vertical-align: bottom;
      margin-right: .25em;
      .#{$style-prefix}-icon {
        color: #0275d8;
      }
    }
    .#{$style-prefix}-plus:before {
      content: "\E645";
    }
    .#{$style-prefix}-minus:before {
      content: "\E621";
    }
  }
  .#{$tree-prefix-cls}-droppoint:hover {
    background-color: #0275d8;
  }
  /** Dragover **/
  &.#{$treenode-prefix-cls}-dragover {
    border-color: #156090;
  }
  /** Loading **/
  &.#{$tree-prefix-cls}-loading {
    position: relative;
    min-height: 4em;
  }
  .#{$tree-prefix-cls}-loading-mask {
    position: absolute;
    width: 100%;
    height: 100%;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
    opacity: 0.1;
    z-index: 1;
  }
  .#{$tree-prefix-cls}-loading-content {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    margin-top: -1em;
    margin-left: -1em;
  }
  /** Check Box **/
  .#{$style-prefix}-chkbox {
    display: inline-block;
    cursor: pointer;
    vertical-align: middle;
    margin-right: .25em;
    .#{$style-prefix}-chkbox-icon {
      display: block;
    }
    .#{$style-prefix}-chkbox-box {
      width: 16px;
      height: 16px;
      line-height: 16px;
      -moz-border-radius: $tree-border-radius-base;
      -webkit-border-radius: $tree-border-radius-base;
      border-radius: $tree-border-radius-base;
      text-align: center;
      overflow: hidden;
      &:hover {
        border-color: $tree-check-box-border-h;
        background: $tree-check-box-bg-h;
        color: $tree-check-box-color-h;
        transition: all .3s;
      }
    }
    .#{$style-prefix}-check {
      background: $tree-check-box-bg;
      transition: all .3s;
      color: $tree-check-box-color;
    }
  }
  /** Icon **/
  .fa {
    display: inline-block;
    font: normal normal normal 14px/1 $iconfont-css-prefix !important;
    font-size: initial;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-transition: -webkit-transform .3s;
    transition: -webkit-transform .3s;
    transition: transform .3s;
  }
  .#{$style-prefix}-caret-right:before {
    font-size: 16px;
    display: inline-block;
    font-family: $iconfont-css-prefix !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\e606";
    font-weight: 700;
    -webkit-transition: -webkit-transform .3s;
    transition: -webkit-transform .3s;
    transition: transform .3s;
    -webkit-transform: rotate(270deg) scale(.59);
    transform: rotate(270deg) scale(.59);
  }
  .#{$style-prefix}-caret-down:before {
    font-size: 16px;
    -webkit-transform: scale(.59) rotate(0);
    transform: scale(.59) rotate(0);
    display: inline-block;
    font-family: $iconfont-css-prefix !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\e606";
    font-weight: 700;
    -webkit-transition: -webkit-transform .3s;
    transition: -webkit-transform .3s;
    transition: transform .3s, -webkit-transform .3s;
  }
  .anticon-folder:before {
    content: "\E662";
    font-weight: 700;
  }
  .anticon-folder-open:before {
    content: "\E699";
    font-weight: 700;
  }
  .anticon-addfolder:before, .anticon-folder-add:before {
    content: "\E914";
    font-weight: 700;
  }
  .#{$style-prefix}-check:before {
    content: "\E632";
  }
  .#{$style-prefix}-minus:before {
    content: "\E624";
  }
}

.#{$style-prefix}-corner-all {
  -moz-border-radius: $tree-border-radius-base;
  -webkit-border-radius: $tree-border-radius-base;
  border-radius: $tree-border-radius-base;
}

.#{$style-prefix}-state-default {
  border: 1px solid $tree-default-color;
  background: $tree-default-bg;
  color: $tree-default-color;
  a {
    color: #555;
  }
}

.#{$style-prefix}-fluid {
  .#{$tree-prefix-cls} {
    width: 100%;
  }
}

.#{$tree-prefix-cls}-draghelper {
  border: 1px solid #0275d8;
}

.#{$style-prefix}-widget, &.#{$style-prefix}-widget * {
  box-sizing: border-box;
}

.#{$style-prefix}-widget-content {
  border: 1px solid #ddd;
  background: $tree-default-bg;
  color: #333;
  a {
    color: #333;
  }
}

.#{$style-prefix}-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
